<script type="text/javascript">
	//List Configuration
	$j("#list_medicine").jqGrid({
		url:'medicine/list',
		datatype:'json',
		mtype:'POST',
		colNames:['Nombre','Descripcion'],
		colModel:[
		          {name: 'name', index: 'name', width: 50, editable: true},		
		          {name: 'description', index: 'description', width: 80, editable: true}
		],
		pager:'#gridpager_medicine',
		loadtext: 'Cargando Medicamentos ...',
		rowNum:10,
		rowList:[10],
		sortname:'name',
		sortorder:'asc',
		autowidth:true,
		viewrecords:true,
		onSelectRow:function(id){},
		editurl:'medicine/save',
		scrollOffset:0
		//caption:'Medicamentos'
	});

	$j("#list_medicine").setGridHeight(220);
	
	//Form editing
	$j("#list_medicine").jqGrid('navGrid','#gridpager_medicine',{
			edit:true,
			add:true,
			del:true,
			search:true},
			{
				closeAfterEdit:true,
				editCaption: "Modificar Medicamento"
			},
			{
				closeAfterAdd:true,
				addCaption: "Nuevo Medicamento"
			},
			{
				msg: "¿Desea eliminar el medicamento seleccionado?",
				caption: "Eliminar Medicamento",
				width:300
			},
			{
				sopt:['eq','bw','ew','cn']
			});
</script>